﻿package plugin.chatflash
{
    import cmd.*;
    import com.core.*;
    import com.sh.game.consts.*;
    import com.sh.game.net.*;
    import flash.utils.*;
    import manager.*;

    public class ClientGm extends Object
    {
        static var time:int = 0;
        static var dic:Dictionary = new Dictionary();
        static var timeCount:int = 0;

        public function ClientGm()
        {
            return;
        }// end function

        public static function doGm(param1:String) : void
        {
            var _loc_2:* = param1.split(" ");
            switch(_loc_2[1])
            {
                case "全屏刷怪流":
                {
                    if (!dic[_loc_2[1]])
                    {
                        dic[_loc_2[1]] = killAll;
                        var _loc_4:* = timeCount + 1;
                        timeCount = _loc_4;
                    }
                    if (timeCount > 0)
                    {
                        if (time == 0)
                        {
                            setInterval(doTime, 60);
                        }
                    }
                    break;
                }
                case "关闭全屏刷怪流":
                {
                    if (dic[_loc_2[1]])
                    {
                        delete dic[_loc_2[1]];
                        var _loc_4:* = timeCount - 1;
                        timeCount = _loc_4;
                    }
                    if (timeCount == 0)
                    {
                        if (time > 0)
                        {
                            clearInterval(time);
                            time = 0;
                        }
                    }
                    break;
                }
                case "获取行会80以下装备":
                {
                    ModelProxy.change("union", "getDebug", null);
                    break;
                }
                case "传送":
                {
                    PluginManager.instance.sendToServer("activity", CMDActivity.Trans, {x:_loc_2[3], y:_loc_2[4], tostageid:_loc_2[2], free:1});
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public static function killAll() : void
        {
            Server.instance.send(99, 0, "@killall", 0, ConnectType.SYSTEM);
            return;
        }// end function

        public static function doTime() : void
        {
            var _loc_1:Function = null;
            for each (_loc_1 in dic)
            {
                
                ClientGm._loc_1();
            }
            return;
        }// end function

    }
}
